package drds.server.datasource;

import java.io.IOException;
import java.io.UnsupportedEncodingException;

import drds.server.handler.Handler;
import drds.server.net.Closable;
import drds.server.route.RouteNode;
import drds.server.server.SessionContext;

public interface IConnectionHolder extends Closable {
	public boolean isModifiedSQLExecuted();

	public boolean isSlaveDataBase();

	public String getSchema();

	public void setSchema(String schema);

	public long getLastTime();

	public boolean isClosedOrQuit();

	public void setAttachment(Object attachment);

	public void quit();

	public void setLastTime(long lastTime);

	public void release();

	public boolean setHandler(Handler handler);

	public void commit();

	public void rollback();

	public void query(String sql) throws UnsupportedEncodingException;

	public Object getAttachment();

	public void execute(RouteNode node, SessionContext sessionContext, boolean autoCommit) throws IOException;

	public boolean syncAndExcute();

	public boolean isBorrowed();

	public void setBorrowed(boolean borrowed);

	public int getTransactionIsolation();

	public boolean isAutoCommit();

	public long getId();

	public void discardClose(String reason);

}
